﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Windows.Media.Imaging;
using System.Windows.Markup;
using System.IO;

namespace TableTop.DataManagement.Addon
{
    [Serializable]
    [DataContract(Namespace="http://www.tabletop.net/Addon")]
    public class AddonInfo
        : MarshalByRefObject
    {
        [DataMember]
        private string strDescription = null;

        [DataMember]
        private string strName = String.Empty;

        [DataMember]
        private Guid gdAddonGuid = Guid.Empty;

        [DataMember]
        // private BitmapImage biAddonIcon;       
        private String strAddonIcon = String.Empty;

        public String Description
        {
            get
            {
                return this.strDescription;
            }

            private set
            {
                this.strDescription = value;
            }
        }

        public String Name
        {
            get
            {
                return this.strName;
            }

            private set
            {
                this.strName = value;
            }
        }

        public Guid GUID
        {
            get
            {
                return this.gdAddonGuid;
            }

            private set
            {
                this.gdAddonGuid = value;
            }
        }

        public String AddonIcon
        {
            get
            {
                return this.strAddonIcon;
            }

            private set
            {                
                this.strAddonIcon = XamlWriter.Save(value);
            }
        }

        public AddonInfo()
        {
        }

        internal AddonInfo(String Name, String Description, Guid GUID)
            : this(Name, Description, GUID, null)
        {
         
        }

        internal AddonInfo(String Name, String Description, Guid GUID, String AddonIcon)
        {
            this.Name = Name;
            this.Description = Description;
            this.GUID = GUID;
            this.strAddonIcon = AddonIcon;
        }
    }
}
